/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package MyDatabase;

import java.util.ArrayList;

/**
 *
 * @author Welcome
 */
public class MyData {
    
    //<editor-fold defaultstate="collapsed" desc="1/Danh sach thuoc tinh">
    private ArrayList<String> data;
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc="2/Cac phuong thuc khoi tao">
    public MyData()
    {
        data = new ArrayList<String>();
    }
    
    public MyData(ArrayList<String> _data)
    {
        data = new ArrayList<String>(_data);
    }
    public MyData(MyData myData)
    {
        data = new ArrayList<String>(myData.data);
    }
    //</editor-fold>
    
    //<editor-fold defaultstate="collapsed" desc="3/Getter/Setter">
    public ArrayList<String> getData() {
        return data;
    }
    
    public void setData(ArrayList<String> data) {
        this.data = data;
    }
    //</editor-fold>
    
    //<editor-fold defaultstate="collapsed" desc="4/Cac phuong thuc nghiep vu">
    public int getSize()
    {
        return data.size();
    }
    
    public String getAt(int index)
    {
        return data.get(index);
    }
    
    public void addContent(String content)
    {
        data.add(content);
    }
    
    public void setContentAt(int index, String content)
    {
        data.set(index, content);
    }
    
    public void clearAll()
    {
        data.clear();
    }
    
    public void showData()
    {
        for(int i=0;i<data.size();i++)
            System.out.print(data.get(i)+" ");
        
        System.out.println();
    }
    //</editor-fold>
}
